Clarify that Tree.create_item(), Tree.set_columns() & Tree.clear() can fail & when.#1207
Conversation
…can fail & when.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughDocumentation and error handling enhancements for the Tree GUI class. Error messages are now attached to three operations that are disallowed during mouse selection: clearing the tree, creating items, and modifying column counts. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
JoltedJon
left a comment
There was a problem hiding this comment.
Looks good to me. Merged in on Godot's side already
TL;DR
Tree.create_item(), Tree.set_columns() & Tree.clear()Tree.create_item(), Tree.set_columns() & Tree.clear()Tree.create_item(), Tree.set_columns() & Tree.clear()& add error messages. godotengine/godot#113178This PR updates the documentation for
Tree.create_item(), Tree.set_columns() & Tree.clear()& tells the user that all 3 methods can fail during mouse selection events. It also adds error messages forTree.create_item(), Tree.set_columns() & Tree.clear()The user will get the following error message if attempting to use any of the 3 methods during mouse selection events (Following RedMser's comment in godotengine/godot#105969 (review)):
(This is a test using the script provided by @kleonc in godotengine/godot#103101 (comment))
Text version:
(We use
ERR_FAIL_COND_V_MSGinstead ofERR_FAIL_COND_MSGhere because Godot expects us to return a value or else we get build errors. We just returnnullptrin this case.)Note
Contributed by 2LazyDevs.
Summary by CodeRabbit
Documentation
Bug Fixes